home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / asppw112 / makedir.asp < prev    next >
Encoding:
Text File  |  1999-01-07  |  1.3 KB  |  51 lines

  1. <HTML><BODY>
  2. <%
  3.     ' Method: MakeDir(strDirPathName)
  4.     '
  5.     ' Sample Operation:
  6.     ' Create a sub directory "Godzilla" under "/".
  7.  
  8.     ' This file is provided as part of  ASP Power Widgets Samples
  9.     '
  10.     ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT
  11.     ' WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
  12.     ' INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
  13.     ' OF MERCHANTABILITY AND/OR FITNESS FOR A  PARTICULAR
  14.     ' PURPOSE.
  15.  
  16.     ' Copyright 1997-1998. All rights reserved.
  17.     ' Dalun Software Inc. ASP Power Widgets
  18.     ' http://www.dalun.com
  19.     ' http://members.tripod.com/ActiveServerPage/
  20.  
  21.     sDir   = "Godzilla"
  22.     sDirPathName   = Server.MapPath("/") & "\" & sDir
  23.  
  24.     response.write "Directory """  & sDirPathName & """ to be created.<br>"
  25.  
  26.     Set oFDMgt   = Server.CreateObject("ASPPW.FDMgt")
  27.     iReturnCode  = oFDMgt.MakeDir (sDirPathName)
  28.  
  29.     select case iReturnCode
  30.         case    1:  response.write "Operation succeeds.<br>"
  31.         case   -1:  response.write "Operation failed. "
  32.         case else:
  33.     end select
  34.  
  35.     if oFDMgt.GetLastErrNum <> 0 then
  36.         response.write  cstr(oFDMgt.GetLastErrNum) + " " + oFDMgt.GetLastErrDescription + "<br>"
  37.         if oFDMgt.GetLastErrNum= 75 then
  38.             response.write "Directory already exists."    
  39.         end if 
  40.     end if
  41.  
  42.     Set oFDMgt  =nothing
  43.         
  44. %>
  45. </BODY></HTML>
  46.  
  47.  
  48.  
  49.  
  50.  
  51.